#ifndef KEYBOARD_H
#define KEYBOARD_H

#define ReadIO_Key1 GPIO_Read_Status(GPIOA0,IO_Key1) //低电平有效
#define ReadIO_Key2 GPIO_Read_Status(GPIOB0,IO_Key2)
#define ReadIO_Key3 GPIO_Read_Status(GPIOB0,IO_Key3)

#define KeyLed_ON GPIO_Write_High(GPIOB0,IO_KeyLed);
#define KeyLed_OFF GPIO_Write_Low(GPIOB0,IO_KeyLed);

typedef struct
{
    uint8_t once1;   
    uint8_t once2;   
    uint8_t once3;   
}_key_param;

typedef enum
{
    PSet_0 = 1,
    PSet_1 = 2,
    PSet_2 = 3,
    PSet_3 = 4,
    PSet_4 = 5,
    PSet_5 = 6,
    PSet_6 = 7,
    PSet_7 = 8,
}PSet_E;


extern uint8_t key_pset;
extern uint8_t key_ONOFF;
extern _key_param key_param;
extern uint8_t Prime_Enable;

void Key_IOConfig(void);
void keyboard_delay15ms(void);
void Key_init(void);
void KeyDetection(void);

#endif
